import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test04 {
    public static void main(String[] args) {
        Collection<String> coll=new ArrayList<>();
        coll.add("aaa");
        coll.add("bbb");
        coll.add("ccc");
        coll.add("ddd");
        coll.add("eee");
        Iterator<String> it=coll.iterator();
        while(it.hasNext())
        {
            String s=it.next();
            System.out.println(s);
        }
        /*Iterator<String> it2=coll.iterator();
        while(it2.hasNext()){
            String str1=it.next();
            String str2=it2.next();
            System.out.println(str1);
            System.out.println(str2);
        }*/
        /*Iterator<String> it3=coll.iterator();
        while(it3.hasNext()){
            String str=it3.next();
            if("bbb".equals(str)){
                it.remove();
            }
            System.out.println(str);
        }*/
        System.out.println("-------");
        for(String s:coll){
            System.out.println(s);
        }


    }
}
